<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue.js"></script>
</head>
<!--写法1：通过script标签-->
<!--<script type="text/x-template" id="cpn_id">
<div>
    <h2>我是标题</h2>
</div>
</script>-->

<!--写法2：通过template标签-->
<template id="cpn_id">
    <div>
        <h2>我是标题1</h2>
    </div>
</template>

<body>
<div id="div_id">
    <cpn1></cpn1>
</div>

<script>
    Vue.component("cpn1",{
        template:"#cpn_id"
    });
    const  app=new Vue({
        el:"#div_id"
    })
</script>
</body>
</html>